/**
 * 管理员相关接口请求发送
 */
import request from '../request'
/**
 * 获取管理员列表接口
 * @returns 
 */
async function getAdminList(){
    return await request.get('/adminList')
}
/**
 * 添加管理员接口 post  请求体 
 * @ params payload {adminName,password,rePassword}
 */
async function addAdmin(payload){
    return await request.post('/addAdmin',payload)
}

async function deleteAdmin(_id){
    return await request.get('/deleteAdmin',{params:{_id}})
}

async function login(payload){
    // post 请求体 {adminName,password}
    // {code,msg}
    return await request.post('/login',payload)
}

async function logout(){
    return await request.get('/logout')
}

export default {
    getAdminList,
    addAdmin,
    deleteAdmin,
    login,
    logout
}